package com.hqyj.springBoot.modules.account.dao;

import com.hqyj.springBoot.modules.account.entity.UserRole;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface UserRoleDao {


    @Insert("insert into account_user_role (user_id,role_id) values (#{userId},#{roleId})")
    @Options(useGeneratedKeys = true,keyColumn = "id",keyProperty = "id")
    void insertUserRole(UserRole userRole);

    @Select("select * from account_user_role where id = #{id}")
    UserRole selectUserRoleById(int userRoleId);

}
